import com.sun.deploy.security.BadCertificateDialog;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2024 —03 —28
 * Time: 20:44
 */
public class Test {
    public static void main(String[] args) {
        MySingleList mySingleList = new MySingleList();//实例化一个MySingleList类
        mySingleList.createList();
        mySingleList.display();
        System.out.println("初始链表的长度为："+mySingleList.size());

        System.out.println("===========下面测试头插法==============");

        mySingleList.addfirst(99);
        mySingleList.display();

        System.out.println("========下面测试尾插法=========");
        mySingleList.addlast(99);
        mySingleList.display();

        System.out.println("=============下面测试任意位置插入法===============");
        mySingleList.addIndex(0,55);//调用了add.first
        mySingleList.addIndex(1,66);
        //mySingleList.addIndex(-1,66);//太帅了，帅的突破范围了
        mySingleList.display();

        System.out.println("=============下面测试任意位置删除法===============");

        mySingleList.remove(66);
        mySingleList.remove(55);
        mySingleList.remove(0);//如果没有找到那个value呢
        mySingleList.remove(99);
        mySingleList.remove(99);

        mySingleList.display();
    }



}
